﻿namespace MicroCloud.Message.Dtos
{
    /// <summary>
    /// 输出DTO：消息接收者
    /// </summary>
    [MapFrom(typeof(MessageReceiver))]
    public class MessageReceiverOutputDto : IOutputDto
    {
        #region "属性"
        #region "获取或设置 编号"
        /// <summary>
        /// 获取或设置 编号
        /// </summary>
        [DisplayName("编号")]
        public long Id { get; set; }
        #endregion

        #region "获取或设置 消息编号"
        /// <summary>
        /// 获取或设置 消息编号
        /// </summary>
        [DisplayName("消息编号")]
        public long MessageId { get; set; }
        #endregion
        #region "获取或设置 接收者编号"
        /// <summary>
        /// 获取或设置 接收者编号
        /// </summary>
        [DisplayName("接收者编号")]
        public long ReceiverId { get; set; }
        #endregion
        #region "获取或设置 接收者名称"
        /// <summary>
        /// 获取或设置 接收者名称
        /// </summary>
        [DisplayName("接收者名称")]
        public string ReceiverName { get; set; }
        #endregion
        #region "获取或设置 接收者昵称"
        /// <summary>
        /// 获取或设置 接收者昵称
        /// </summary>
        [DisplayName("接收者昵称")]
        public string ReceiverNickname { get; set; }
        #endregion
        #region "获取或设置 发送方式集合"
        /// <summary>
        /// 获取或设置 发送方式集合
        /// </summary>
        [DisplayName("发送方式")]
        public MessageSendWay[] SendWays { get; set; }
        #endregion
        #region "获取或设置 阅读时间"
        /// <summary>
        /// 获取或设置 阅读时间
        /// </summary>
        [DisplayName("阅读时间")]
        public DateTime? LastReadTime { get; set; }
        #endregion
        #region "获取或设置 阅读方式"
        /// <summary>
        /// 获取或设置 阅读方式
        /// </summary>
        [DisplayName("阅读方式")]
        public MessageSendWay? LastReadWay { get; set; }
        #endregion

        #region "获取或设置 创建时间 ICreatedTime、ICreationAudited  可装载接口，在数据创建时可自动设置当前时间"
        /// <summary>
        /// 获取或设置 创建时间
        /// </summary>
        [DisplayName("创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region "获取 是否已读"
        /// <summary>
        /// 获取 是否已读
        /// </summary>
        [DisplayName("是否已读")]
        public bool IsRead => LastReadTime.HasValue;
        #endregion

        #endregion

    }

}
